<?php

namespace app\helpers;

class Send
{
    public static function sendLine($mobile,$content)
    {
        $codeHelper = new Code($mobile);
        $result = $codeHelper->sendSMS($content);
        return $result;
    }

    //给客服发短信
    public static function sendLineService($content)
    {
        $mobile = '8618751310774';
        return self::sendLine($mobile, $content);
    }

    public static function sendEmail($title, $content, $email, $nickname, $isHtml = false)
    {
        $redis = Redis::getRedis();
        $hashKey = 'email_send_hash';
        $redis->hSet($hashKey, $email . Str::getOutTradeNo(), json_encode([
            'title' => $title,
            'content' => $content,
            'email' => $email,
            'nickname' => $nickname,
            'isHtml' => $isHtml ? '1' : '0'
        ]));
    }
}